/* 基础重置与全局样式 */
* {  /* 通配符选择器，选中所有元素 */
  margin: 0;  /* 清除所有元素的外边距 */
  padding: 0; /* 清除所有元素的内边距 */
  box-sizing: border-box; /* 改变盒模型计算方式（包含border和padding在宽高内） */
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; /* 设置全局字体栈 */

}

body {  /* 页面主体样式 */
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f8ff 100%);
  line-height: 1.6;     /* 行高（文本行间距） */
  color: #000000;
  padding: 0;        /* 页面内容与视口的间距 */
  min-height: 100vh;
  position: relative;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  font-weight: 500;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="none" stroke="rgba(0,75,128,0.05)" stroke-width="1" x="0" y="0" width="100" height="100"/></svg>');
  z-index: -1;
  opacity: 0.3;
}

/* 顶部导航栏 */
.navbar {
  background: linear-gradient(90deg, #005887e8 0%, #002b50 100%);
  padding: 0.8rem 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  font-size: 2.2rem;
  color: #ffd700;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  letter-spacing: 1px;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-link i {
  font-size: 1.1rem;
}

/* 用户信息 */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.15);
}

.user-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 8px 20px rgba(0, 75, 128, 0.1);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 75, 128, 0.15);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #004b87, #3498db);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.4rem;
  color: #004b87;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: #3498db;
  font-size: 1.6rem;
}

/* 统计卡片 */
.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #004b87;
  margin: 10px 0;
}

.stat-card .stat-label {
  color: #7f8c8d;
  font-size: 1rem;
}

.stat-card .trend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #27ae60;
  font-weight: 500;
}

/* 标题样式 */
h1, h2, h3 {
  color: #005887e8;
  margin-bottom: 1.5rem;
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
}

h1::after, h2::after, h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 4px;
  background: linear-gradient(to right, #004b87, #3498db);
  border-radius: 2px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 20px;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.9rem 1.8rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}

.btn i {
  font-size: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #004b87 0%, #3498db 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #003a6a 0%, #2980b9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7d 100%);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.8rem;
}

.form-label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e7ee;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-size: 1rem;
  background: #f8fafc;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
  background: white;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.book-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.book-table th {
  background: linear-gradient(to bottom, #004b87, #00315e);
  color: white;
  padding: 1.2rem 1.5rem;
  text-align: left;
  font-weight: 600;
}

.book-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #edf2f7;
}

.book-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.book-table tr:hover {
  background-color: #f0f7ff;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.available {
  background: rgba(46, 204, 113, 0.15);
  color: #27ae60;
}

.borrowed {
  background: rgba(231, 76, 60, 0.15);
  color: #c0392b;
}

.reserved {
  background: rgba(241, 196, 15, 0.15);
  color: #d35400;
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  gap: 10px;
}

/* 页脚 */
footer {
  background: linear-gradient(90deg, #002b50 0%, #001a33 100%);
  color: rgba(255, 255, 255, 0.7);
  padding: 2rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .nav-list {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .action-buttons {
    flex-wrap: wrap;
  }
}